package it.ap.sa.core.dao.hibernate.envers;

import org.hibernate.envers.RevisionListener;

import it.ap.sa.core.utils.AuthUtils;

/**
 * @author Alessandro Paolillo
 */
public class ExtendRevisionListener implements RevisionListener {

	@Override
	public void newRevision(Object revisionEntity) {
		
		ExtendRevisionEntity revEntity = (ExtendRevisionEntity) revisionEntity;

		/**
		 * Recupero i dati dell'utente autenticato 
		 */
		revEntity.setUsername(AuthUtils.getLoggedUsername());
	}
}
